<%@ page language="java" import="java.util.*,com.king.cms.common.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<body bgcolor="#FFFFFF">
<table cellspacing="0" cellpadding="0" width="100%">

 <tr >
   <td style="width:24px">SessionId
   </td>
   <td style="width:80px" >User
   </td>
   <td style="width:80px" >Login Time
   </td>
   <td style="width:80px" >Last access Time
   </td>
 </tr>
<%
 Vector activeSessions = (Vector) application.getAttribute("activeSessions");
 if (activeSessions == null)
 {
   activeSessions = new Vector();
   application.setAttribute("activeSessions",activeSessions);
 }
 
 Iterator it = activeSessions.iterator();
 while (it.hasNext())
 {
   HttpSession sess = (HttpSession)it.next();
   UserObj sessionUser = (UserObj)sess.getAttribute("user");
   String userId = (sessionUser!=null)?sessionUser.getUserID():"None";
%>
 <tr>
     <td nowrap=''><%= sess.getId() %></td>
     <td nowrap=''><%= userId %></td>
     <td nowrap=''>
   <%=  new java.util.Date(sess.getCreationTime())).getDateTimeString()%></td>
     <td  nowrap=''>
   <%=  new java.util.Date(sess.getLastAccessedTime())).getDateTimeString()%></td>
 </tr>
<%
 }
%>
</table>
</body>
